class Todo(object):
    xuhao_id = 0
    @classmethod
    def next_id(cls):
        Todo.xuhao_id += 1
        return Todo.xuhao_id
    def __init__(self,title:str,completed = False,id:int = 0):
        self.id =id if id>0 else Todo.next_id()
        self.title = title
        self.completed =completed

# l = Todo('enen')
# print(l.__dict__)
# l1 = Todo(title='enen',completed=True,id=3)
# print(l1.__dict__)
# dicts = {
#     'title' : 'enen',
#     'completed':True,
#     'id': 3
#
# }
# l2 = Todo(**dicts)
# print(l2.__dict__)